import { Button } from 'antd'
import { CountWrapper } from './style'
import { useSelector, useDispatch } from 'react-redux'
import { countAction } from '@/store/redux-saga/actions'

const Count = () => {
	const count = useSelector(state => state.count.count)
	const dispatch = useDispatch()
	return <CountWrapper>
		<span>{count}</span>
		<Button type='primary' onClick={() => dispatch(countAction.countAction.countNum())}>同步加5</Button>
		<Button type='primary' onClick={() => dispatch(countAction.countSagaAction.countNum())}>异步加5</Button>
	</CountWrapper>
}
export default Count